//package comc.springbatch;
//
//import org.springframework.batch.core.*;
//import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
//import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;
//import org.springframework.batch.core.configuration.annotation.StepBuilderFactory;
//import org.springframework.batch.core.scope.context.ChunkContext;
//import org.springframework.batch.core.step.tasklet.Tasklet;
//import org.springframework.batch.item.ItemReader;
//import org.springframework.batch.item.ItemWriter;
//import org.springframework.batch.item.support.ListItemReader;
//import org.springframework.batch.repeat.RepeatStatus;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.scheduling.annotation.EnableScheduling;
//
//import java.util.Arrays;
//import java.util.List;
//import java.util.Map;
//
////Job参数
//@Configuration
//@EnableBatchProcessing
//@EnableScheduling
//public class BatchTest2 implements StepExecutionListener {
//    @Autowired
//    public JobBuilderFactory jobBuilderFactory;
//    @Autowired
//    public StepBuilderFactory stepBuilderFactory;
//    @Autowired
//    public MyDecider myDecider;
//
//    private Map<String, JobParameter> parametersMap;
//    @Bean
//    public Job job2(){
//        return jobBuilderFactory.get("job33")
//                .start(step2()).listener(new MyJobListener()).build();
//    }
//    @Bean
//    public Step step2() {
//        return stepBuilderFactory.get("step33")
//                .listener(new MyChunkListiener())
//                .tasklet(new Tasklet() {
//                    @Override
//                    public RepeatStatus execute(StepContribution stepContribution, ChunkContext chunkContext) throws Exception {
//                        System.out.println("获取到的传递数据"+parametersMap.get("par"));
//                        return RepeatStatus.FINISHED;
//                    }
//                }).build();
//
//    }
//
//    @Override
//    public void beforeStep(StepExecution stepExecution) {
//        parametersMap=  stepExecution.getJobParameters().getParameters();
//    }
//
//    @Override
//    public ExitStatus afterStep(StepExecution stepExecution) {
//        return null;
//    }
//}
